import Layout from '../views/layout/Layout'

const _import = require('./_import_' + process.env.NODE_ENV);

export default {
  path: '/commodity',
  component: Layout,
  name: 'commodity',
  meta: {title: '商品管理', icon: 'icon'},
  children: [
    {
      path: 'manage',
      component: _import('commodity/manage/list'),
      name: 'commodityManage',
      props: {goodsType: 1},
      meta: {
        title: '商品管理',
        buttons: {
          export: { label: '导出查询结果', enabled: true },
          view: { label: '查看', enabled: true },
          viewDownShelf: { label: '下架', enabled: true },
          edit: { label: '编辑', enabled: true }
        }
      }
    },
    {
          path: 'package',
          component: _import('activity/package/list'),
          name: 'activityPackage',
          meta: {
            title: '套餐管理',
            buttons: {
              add: {
                label: '新建',
                enabled: true
              },
              edit: {
                label: '编辑',
                enabled: true
              },
              view: {
                label: '查看',
                enabled: true
              },
              export: {
                label: '导出',
                enabled: true
              }
            }
          },
        },
    {
      path: 'type',
      component: _import('commodity/type/list'),
      name: 'commodityType',
      meta: {
        title: '类型管理',
        buttons: {
          attr: { label: '属性', enabled: true }
        }
      }
    },
    {
      path: 'category',
      component: _import('commodity/category/list'),
      name: 'commodityCategory',
      meta: {
        title: '分类管理',
        buttons: {
          add: { label: '新建一级分类', enabled: true },
          addSub: { label: '新建子类', enabled: true },
          edit: { label: '编辑', enabled: true },
          delete: { label: '删除', enabled: true }
        }
      }
    },
    {
      path: 'brand',
      component: _import('commodity/brand/list'),
      name: 'brand',
      meta: {
        title: '品牌管理',
        // noCache: true,
        buttons: {
          add: { label: '新增', enabled: true },
          edit: { label: '编辑', enabled: true },
          goods: { label: '商品管理', enabled: true },
          delete: { label: '删除', enabled: true }
        }
      }
    },
    {
      path: 'tag',
      component: _import('commodity/tag/list'),
      name: 'commodityTag',
      meta: {
        title: '标签管理',
        buttons: {
          add: { label: '新建', enabled: true },
          edit: { label: '编辑', enabled: true },
          delete: { label: '删除', enabled: true },
          goods: { label: '查看商品', enabled: true }
        }
      }
    },
    {
      path: 'sku',
      component: _import('commodity/sku/list'),
      name: 'commoditySku',
      props: {skuType: 1},
      meta: {
        title: '库存管理',
        buttons: {
          set: { label: '库存告警设置', enabled: true }
        }
      }
    },
    {
      path: 'freight',
      component: _import('commodity/freight/list'),
      name: 'freight',
      meta: {
        title: '运费模板管理',
        // noCache: true,
        buttons: {
          add: { label: '新增配置模板', enabled: true },
          view: { label: '查看配置模板', enabled: true },
          template: { label: '运费模板列表', enabled: true },
          templateAdd: { label: '新增运费模板', enabled: true },
          templateEdit: { label: '编辑运费模板', enabled: true },
          templateCopy: { label: '复制运费模板', enabled: true }
        }
      }
    },
    {
        path: 'goodsSnTranslate',
        component: _import('tools/goodsSnTranslate/index'),
        name: 'goodsSnTranslate',
        meta: {title: 'E3商品编码转换'},
    },
    /*{
        path: 'preManage',
        component: _import('commodity/manage/list'),
        name: 'commodityPreManage',
        props: { goodsType: 2 },
        meta: {title: '虚拟商品管理', roles: [1, 9]}
    },
    {
      path: 'manage/add',
      component: _import('commodity/manage/edit'),
      name: 'commodityManageAdd',
      meta: {title: '商品添加', index: '/commodity/manage'},
      hidden: true
    },
    {
      path: 'preManage/add',
      component: _import('commodity/manage/edit'),
      name: 'commodityPreManageAdd',
      meta: {title: '虚拟商品添加', index: '/commodity/preManage'},
      hidden: true
    },*/
    {
      path: 'manage/view/:id',
      component: _import('commodity/manage/edit'),
      name: 'commodityManageView',
      meta: {
        title: '商品查看',
        noCache: true,
        index: '/commodity/manage',
        buttons: {
          downShelf: { label: '下架', enabled: true }
        }
      },
      hidden: true,
      props: true
    },
    {
      path: 'manage/edit/:id',
      component: _import('commodity/manage/edit'),
      name: 'commodityManageEdit',
      meta: {title: '商品编辑', noCache: true, index: '/commodity/manage'},
      hidden: true,
      props: true
    },
    /* {
      path: 'preManage/edit/:id',
      component: _import('commodity/manage/edit'),
      name: 'commodityPreManageEdit',
      meta: {title: '虚拟商品编辑', noCache: true, index: '/commodity/preManage'},
      hidden: true,
      props: true
    }, */
    {
      path: 'evaluation',
      component: _import('commodity/evaluation/list'),
      name: 'evaluation',
      meta: {
        title: '商品评价',
        buttons: {
          examine: { label: '审核', enabled: true },
          batchExamine: { label: '批量审核', enabled: true }
        }
      }
    },
    {
      path: 'tagGoods/:id/:name',
      component: _import('commodity/tag/goods/list'),
      name: 'commodityTagGoods',
      meta: {title: '标签商品', index: '/commodity/tag'},
      hidden: true,
      props: true
    },
    {
      path: 'type/attr/:id/:name',
      component: _import('commodity/type/attr'),
      name: 'commodityTypeAttr',
      meta: {title: '商品属性', noCache: true},
      hidden: true,
      props: true
    },
    {
      path: 'skuWarn',
      component: _import('commodity/sku/skuWarn'),
      name: 'commoditySkuSet',
      meta: {
        title: '库存警告设置',
        // buttons: {
        //   set: { label: '库存告警设置', enabled: true }
        // }
      },
      hidden: true
    },
    // 运费模板相关路由 zlf start
    {
      path: 'freightAdd',
      component: _import('commodity/freight/edit'),
      name: 'freightAdd',
      meta: {title: '新增配置模板', noCache: true, index: '/commodity/freight'},
      hidden: true
    },
    {
      path: 'freightView/:id',
      component: _import('commodity/freight/edit'),
      name: 'freightView',
      meta: {title: '查看配置模板', noCache: true, index: '/commodity/freight'},
      hidden: true,
      props: true
    },
    {
      path: 'freightTemplate',
      component: _import('commodity/freight/freightm/mlist'),
      name: 'freightTemplate',
      meta: {
        title: '运费模板列表',
        // noCache: true,
        index: '/commodity/freight',
        buttons: {
          copy: { label: '复制', enabled: true },
          add: { label: '新增运费模板', enabled: true },
          edit: { label: '编辑运费模板', enabled: true }
        }
      },
      hidden: true
    },
    {
      path: 'freightTemplateAdd',
      component: _import('commodity/freight/freightm/mfreight'),
      name: 'freightTemplateAdd',
      meta: {title: '添加运费模板', noCache: true, index: '/commodity/freight'},
      hidden: true,
      props: true
    },
    {
      path: 'freightTemplateEdit/:id',
      component: _import('commodity/freight/freightm/mfreight'),
      name: 'freightTemplateEdit',
      meta: {title: '编辑运费模板', noCache: true, index: '/commodity/freight'},
      hidden: true,
      props: true
    },
    {
      path: 'brand/add',
      component: _import('commodity/brand/edit'),
      name: 'brandAdd',
      meta: {title: '新建品牌', noCache: true, index: '/commodity/brand/list'},
      hidden: true
    },
    {
      path: 'brand/:id/edit',
      component: _import('commodity/brand/edit'),
      name: 'brandEdit',
      meta: {title: '编辑品牌', noCache: true, index: '/commodity/brand/list'},
      hidden: true,
      props: true
    },
    {
      path: 'brand/:id/goods',
      component: _import('commodity/brand/goods'),
      name: 'brandGoods',
      meta: {title: '品牌商品管理', noCache: true, index: '/commodity/brand/list'},
      hidden: true,
      props: true
    }
  ]
}
